package com.client.controller;

import com.client.pojo.PointsTransactions;
import com.client.service.PointsTransactionsService;
import com.client.utils.ResponseMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户积分流水表 前端控制器
 * </p>
 *
 * @author ckick
 * @since 2025-09-20 08:28:54
 */
@RestController
@RequestMapping("/pointsTransactions")
public class PointsTransactionsController {
    @Autowired
    private PointsTransactionsService pointsTransactionsService;
    @GetMapping("/getPointsTransactionsById/{userId}")
    public ResponseMsg getPointsTransactionsById(@PathVariable Integer userId) {
        List<PointsTransactions> points = pointsTransactionsService.getPointsTransactionsById(userId);
        return ResponseMsg.getInstance(ResponseMsg.SUCCESS, "查询成功", points);
    }
}
